<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%
	pageContext.setAttribute("APP_PATH", request.getContextPath());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>被询问人历史信息查询</title>
<link href="${APP_PATH}/static2/css/style.css" rel="stylesheet"
	type="text/css" />
<link href="${APP_PATH}/static2/css/xilaxuanze.css" rel="stylesheet"
	type="text/css" />
<script type="text/javascript" src="${APP_PATH}/static2/js/jquery.js"></script>
<script src="${APP_PATH}/static2/My97DatePicker/WdatePicker.js"
	type="text/javascript"></script>
	<link href="${APP_PATH}/static2/jquery-jbox/2.3/Skins/Bootstrap/jbox.min.css" rel="stylesheet"/>
<script src="${APP_PATH}/static2/jquery-jbox/2.3/jquery.jBox-2.3.min.js" type="text/javascript"></script>
	
<script type="text/javascript">
	$(function() {
		//移到右边
		$('#add').click(function() {
			//先判断是否有选中
			if (!$("#select1 option").is(":selected")) {
				alert("请选择需要移动的选项")
			}
			//获取选中的选项，删除并追加给对方
			else {
				$('#select1 option:selected').appendTo('#select2');
			}
		});

		//移到左边
		$('#remove').click(function() {
			//先判断是否有选中
			if (!$("#select2 option").is(":selected")) {
				alert("请选择需要移动的选项")
			} else {
				$('#select2 option:selected').appendTo('#select1');
			}
		});

		//全部移到右边
		$('#add_all').click(function() {
			//获取全部的选项,删除并追加给对方
			$('#select1 option').appendTo('#select2');
		});

		//全部移到左边
		$('#remove_all').click(function() {
			$('#select2 option').appendTo('#select1');
		});

		//双击选项
		$('#select1').dblclick(function() { //绑定双击事件
			//获取全部的选项,删除并追加给对方
			$("option:selected", this).appendTo('#select2'); //追加给对方
		});

		//双击选项
		$('#select2').dblclick(function() {
			$("option:selected", this).appendTo('#select1');
		});

	});
</script>

<script>
	$(function() {
		//全选或全不选
		$("#all").click(function() {
			if (this.checked) {
				$("#list :checkbox").prop("checked", true);
			} else {
				$("#list :checkbox").prop("checked", false);
			}
		});
		//全选  
		$("#selectAll").click(function() {
			$("#list :checkbox,#all").prop("checked", true);
		});
		//全不选
		$("#unSelect").click(function() {
			$("#list :checkbox,#all").prop("checked", false);
		});
		//反选 
		$("#reverse").click(function() {
			$("#list :checkbox").each(function() {
				$(this).prop("checked", !$(this).prop("checked"));
			});
			allchk();
		});

		//设置全选复选框
		$("#list :checkbox").click(function() {
			allchk();
		});

		//获取选中选项的值
		$("#getValue").click(function() {
			var valArr = new Array;
			$("#list :checkbox[checked]").each(function(i) {
				valArr[i] = $(this).val();
			});
			var vals = valArr.join(',');
			alert(vals);
		});
	});
	function allchk() {
		var chknum = $("#list :checkbox").size();//选项总个数
		var chk = 0;
		$("#list :checkbox").each(function() {
			if ($(this).prop("checked") == true) {
				chk++;
			}
		});
		if (chknum == chk) {//全选
			$("#all").prop("checked", true);
		} else {//不全选
			$("#all").prop("checked", false);
		}
	}
</script>
<script>
	$(function() {
		$("#shanchu").click(function() {
			$("input[name='test']:checked").each(function() { // 遍历选中的checkbox
				n = $(this).parents("tr").index(); // 获取checkbox所在行的顺序
				$("table#list").find("tr:eq(" + n + ")").remove();
			});
		});
	});
</script>




<script type="text/javascript">
	$(document).ready(function() {
		$(".btnxx").click(function() {
			$(".tipyuanxx").fadeIn(200);
		});

		$(".tiptop a").click(function() {
			$(".tipyuanxx").fadeOut(200);
		});

		$(".sure").click(function() {
			$(".tipyuanxx").fadeOut(100);
		});

		$(".cancel").click(function() {
			$(".tipyuanxx").fadeOut(100);
		});
		
		$("#cancelID").click(function() {
			$("input:checkbox[name='suspectCheckbox']").each(function(){
				$(this).removeAttr("checked");
			})
		});
		$("#accompliceSign").click(function() {
			var ids = "";
			var checkboxs = $("input:checkbox[name='suspectCheckbox']:checked");
			//alert(checkboxs.length);
			if (checkboxs.length < 1) {
				alert("请至少选择一条数据！");
				return false;
			}
			$.each(checkboxs, function(index, item) {
				ids = ids + $(item).attr("dataId") + ","
			});
			if (ids.indexOf(",") != -1) {
				ids = ids.substring(0, ids.length - 1);
			}
			$.ajax({
				url : "${APP_PATH}/per/suspectInfo/accompliceSign",
				type : "post",
				data : {
					'ids' : ids
				},
				success : function(result) {
					//parent.topFrame.location.reload();//刷新top页的在所人数
					//$('#policeUpdateModal').fadeOut(200);
					//$.jBox.tip("操作成功","info");
					 parent.location.reload();
					window.parent.window.jBox.close();
				},error:function(){
					$.jBox.tip("操作失败。","info");
				}

			});
		});
	});
	//查看详情
	function showSuspectInfoDetail(id) {
		$("#suspectDetailModal form")[0].reset();
		$.ajax({
					url : "${APP_PATH}/per/suspectInfo/getSuspectInfo?infoGUID="
							+ id,
					type : "get",
					success : function(result) {
						//$("#policeUpdateModal select").val([result.inquestRoomNo]);
						//事由
						var banAreaCheckboxs = $("input:checkbox[name='banAreaCheckbox']");
						//禁止区域
						var banAreaCheckboxs = $("input:checkbox[name='banAreaCheckbox']");
						var banAreaArr = [];
						if (result.banArea != null && result.banArea != "") {
							banAreaArr = result.banArea.split(",");
						}

						$.each(banAreaCheckboxs, function(index, item) {
							for (var i = 0; i < banAreaArr.length; i++) {
								if ($(item).val() == banAreaArr[i]) {
									$(item).attr("checked", 'true');
								}
							}
						});

						$("#suspectName_update_input").val(result.suspectName);
						$("#suspectSex_update_input").val(result.suspectSex);
						$("#suspectBirth_update_input")
								.val(result.suspectBirth);
						$("#suspectIDNo_update_input").val(result.suspectIDNo);
						$("#suspectAddress_update_input").val(
								result.suspectAddress);
						$("#suspectDegree_update_input").val(
								result.suspectDegree);
						$("#suspectNationality_update_input").val(
								result.suspectNationality);
						$("#suspectPlace_update_input")
								.val(result.suspectPlace);
						$("#cardNo1_update_input").val(result.cardNo1);
						$("#bringPolice_update_input").val(result.bringPolice);

						$("#suspectTel_update_input").val(result.suspectTel);
						$("#suspectArea_update_input").val(result.suspectArea);
						$("#suspectStature_update_input").val(
								result.suspectStature);
						$("#facelFeature_update_input")
								.val(result.facelFeature);
						$("#shapelFeature_update_input").val(
								result.shapelFeature);
						$("#bloodType_update_input").val(result.bloodType);
						$("#specialFeature_update_input").val(
								result.specialFeature);
						$("#supspocious_update_input").val(result.supspocious);
						$("#suspectRemark_update_input").val(
								result.suspectRemark);

						//
						$("#inTime_update_input").val(result.inTime);
						$("#processedResultupdate_input").val(
								result.processedResult);
						$("#leaveTime_update_input").val(result.leaveTime);
						//authType//事由
						$("input:radio[name='authType']").each(function() {
							if ($(this).val() == result.authType) {
								$(this).attr("checked", true);
							}
						});
						//询问室
						$("#suspectUpdateModal select").val(
								[ result.inquestRoomNo ]);
						//inquestRoomNo//询问室
						//禁止区域

						$("#banArea_update_input").val(result.banArea);
						$("#bagNo_update_input").val(result.goodsInfo.bagNo);
						$("#cupboardNo_update_input").val(
								result.goodsInfo.cupboardNo);
						$("#recvPerson_update_input").val(
								result.goodsInfo.recvPerson);
						$("#recvTimeupdate_input").val(
								result.goodsInfo.recvTime);
						$("#goodsInfoupdate_input").val(
								result.goodsInfo.goodsInfo);
						$("#fillInNameupdate_input").val(result.fillInName);
						$("#suspectDetailModal").fadeIn(200);
					}

				});

	}
</script>
<script type="text/javascript">
	
</script>
<style type="text/css">
.oddColor{background:#CD7054;}
.evenColor{
	background:#4682B4;
}
</style>
</head>
<body>
	<div class="place">
		<ul class="placeul">
			<li>被询问人信息查询</li>
		</ul>
	</div>
	<div class="rightinfo">
<%-- 		<form:form id="searchForm" modelAttribute="suspectInfo"
			action="${APP_PATH}/per/suspectInfo/list" method="post">
			<input id="isLeave" name="isLeave" type="hidden" value="0" />
			<div class="tools">
				姓名<input name="suspectName" type="text" maxlength="10"
					value="${suspectInfo.suspectName}" /> 身份证号<input name="suspectIDNo"
					type="text" maxlength="30" value="${suspectInfo.suspectIDNo}" /> 时间<input
					name="inTime" type="text" maxlength="20"
					value="${suspectInfo.inTime}" class="input-medium Wdate required"
					onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true});" />
				<img src="${APP_PATH}/static2/images/chaxun.jpg" width="75"
					height="35" style="vertical-align: middle" onclick="to_page(1)" />
				<div style="width: 100; height: 50; background-color: #000"></div>
			</div>
		</form:form> --%>
				<div class="tools">
			<ul class="toolbar">
				<li id="accompliceSign"><span><img src="${APP_PATH}/static/images/t02.png" /></span>同案标记</li>
				<li id="cancelID"><span><img src="${APP_PATH}/static/images/t03.png" /></span>取消</li>
			</ul>
		</div>
		<table class="imgtable" id="list" rules=rows>
			<tr class="imgtable1">
				<th width="60px;">序号</th>
				<th width="60px;">选择</th>
				<th>姓名</th>
				<th>性别</th>
				<th>询问室</th>
				<th>登记时间</th>
				<th>携带民警</th>
			</tr>
			<c:forEach items="${suspectInfoList}" var="suspectInfo"
				varStatus="pageList">
				<tr class="${suspectInfo.trbkclass}">
					<td>${pageList.index + 1}</td>
					<td class="imgtd"><input type="checkbox"
						name="suspectCheckbox" dataId="${suspectInfo.infoGUID}"></td>
					<td>${suspectInfo.suspectName}</td>
					<td>${suspectInfo.suspectSex}</td>
					<td>${suspectInfo.inquestRoomNo}</td>
					<td>${suspectInfo.inTime}</td>
					<td>${suspectInfo.bringPolice}</td>
				</tr>
			</c:forEach>
		</table>
	</div>
</body>
</html>
